package com.hp.bon.sgw.bean;

/**
 * 记录流量访问信息
 * 
 * @author wanghan
 * 
 */
public class FluxSumSgwViewBean {

	/**
	 * 总计请求次数
	 */
	private volatile long totalRequests;
	/**
	 * 计数器重置时间
	 */
	private volatile long resetTime;
	
	public FluxSumSgwViewBean()
	{
		this.resetTime=System.currentTimeMillis();
	}
	
	public FluxSumSgwViewBean(long resetTime,long period)
	{
		this.resetTime = resetTime;
	}

	public long getTotalRequests() {		
		return totalRequests;
	}

	public void setTotalRequests(long totalRequests) {
		this.totalRequests = totalRequests;
	}

	public void increAccess() {
		this.totalRequests++;
	}

	public long getResetTime() {
		return resetTime;
	}
	
	public void reset() {
		this.resetTime = System.currentTimeMillis();
		this.totalRequests = 0;
	}
	
	public void reset(long now) {
		this.resetTime = now;
		this.totalRequests = 0;
	}

}
